package com.zmj.tl.database.taos.domain;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author hd
 * @desc 示例约束
 * @since 2024/1/29 10:41
 */
@Data
@ToString
@NoArgsConstructor
public class MeterSchema implements Serializable {
    private static final long serialVersionUID = -1498900181174872366L;
    /**
     * 库名
     */
    private String dbName = "power";
    /**
     * 超级表名
     */
    private String tbName = "meters";
    /**
     * 子表名
     */
    private String stbName = "d1001";
    /**
     * 超级表数据列
     */
    private String metricSchema = "ts timestamp, current float, voltage int, phase float";
    /**
     * 超级表Tags
     */
    private String tagSchema = "location binary(64), groupId int";
    /**
     * 数据属性
     */
    private String metricColumn = "ts, current, voltage, phase";
    /**
     * 标签属性
     */
    private String tagColumn = "location, groupId";
    /**
     * 单个写入数据列
     */
    private String oneRow = "#{td.ts}, #{td.current}, #{td.voltage}, #{td.phase}";
    /**
     * 单个写入标签列
     */
    private String oneTag = "#{td.location}, #{td.groupId}";
    /**
     * 批量写入属性
     */
    private String batchRow = "#{item.ts}, #{item.current}, #{item.voltage}, #{item.phase}";
}
